home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / source / tsr_xmpl / tsr_xmpl.asm < prev   
Encoding:
Assembly Source File  |  1994-11-05  |  1.5 KB  |  40 lines

  1. ; assemble this file with : ml /AT tsr_xmpl.asm ...
  2. ; all the stuff to make any of your program a TSR take 1435 bytes !!!
  3.  
  4. PrintMac           MACRO Symbol ;; used in main_prg.inc too !
  5.                    MOV AH,09h
  6.                    MOV DX,OFFSET Symbol
  7.                    INT 21h
  8. ENDM
  9.  
  10. TsrName EQU TSR
  11. TsrId1 EQU 'T'
  12. TsrId2 EQU 'S'
  13. TsrId3 EQU 'R'
  14.  
  15. TsrName            SEGMENT
  16.                    ORG 100h ; it's a .COM file
  17.                    ASSUME CS:TsrName,DS:TsrName
  18.                    .8086 ; don't change it !!! else ... BUG (Why ???)
  19.  
  20. Start:             JMP Installation
  21.  
  22. ; Keep these include in this order !!!
  23.  
  24.                    INCLUDE resident.inc ; contain int handler and other stuff !
  25.                    INCLUDE main_prg.inc ; contain MainPart proc and what you need
  26. EndOfResident:
  27.                    INCLUDE install.inc  ; contain self-detection in memory and more
  28.  
  29. Installation:      PrintMac CopyrightStr
  30.                    CALL DetectPrg       ; set carry flag if already in memory
  31.                    JC RemoveIt
  32.                    JMP InstallPrg ; end whith int 21h, AH=31h
  33. RemoveIt:          JMP RemovePrg  ; end whith int 21h, AH=4Ch
  34.  
  35. CopyrightStr       DB 13,10,"TSR Exemple Program 1.0 - Coded By Sam In 1994 - A TFL/TDV Production",13,10,"$"
  36. InstallStr         DB 13,10,"TSR Installed In Memory - Press Hot-keys SHIFT_LEFT + SHIFT_RIGHT To Use It",13,10,"$"
  37. RemoveStr          DB 13,10,"TSR Removed From Memory - Assembly language is beautifull !!!",13,10,"$"
  38.  
  39. TsrName            ENDS
  40.                    END Start